<?php 
require_once ("DB.php");

function getDBConnection() {
    PEAR::setErrorHandling(PEAR_ERROR_DIE);
    $dsn = array("phptype"  => DB_TYPE,
                 "hostspec" => DB_HOST,
                 "port"     => DB_PORT,
                 "database" => DB_NAME,
                 "username" => DB_USER,
                 "password" => DB_PASSWORD);
    $conn = &DB::connect($dsn);
    $conn->query("SET NAMES 'utf8'");
    return $conn;
}

?>
